/*
	Copyright (c) 2009, Krzysztof Langner

	This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
	You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package flexlint.ant;

import org.apache.tools.ant.taskdefs.MatchingTask;

import flexlint.DirectoryParser;
import flexlint.as.parser.ParseException;

public class FlexLintTask extends MatchingTask {

	// -----------------------------------------------------------------------------------------------
	public void setSrcdir(String dir){
		sourceDir = dir;
	}
	
	// -----------------------------------------------------------------------------------------------
	public void setDestdir(String dir){
		
	}
	
	// -----------------------------------------------------------------------------------------------
	public void execute() {
		DirectoryParser parser = new DirectoryParser(sourceDir);

		try {
			parser.parse();
			log("Processed " + parser.getParsedFilesCount() + " files.");
		} catch (ParseException e) {
			System.out.println(e);
		}
		

	}
	
	// -----------------------------------------------------------------------------------------------
	// Private members
	private String	sourceDir;
}
